package com.william.lifetraxer.util;

import static com.william.lifetraxer.util.Values.*;

public class InfoDAO {
	public static int insertInfo(Info info)
	{
		String insertString = "insert into " + dbInfoTable + " (userid,gender,birthday,phone,email) value(?,?,?,?,?)" ;
		return DbManager.insertInfoDb(insertString,info);
	}
	
	public static int updateInfo(Info info)
	{
		String updateString = "update " + dbInfoTable + " set gender = ? , birthday = ? , phone = ? , email = ? where userid = ?" ;
		return DbManager.updateInfoDb(updateString,info);
	}
	
	public static Info getInfo(String username)
	{
		String selectString = "select gender,birthday,phone,email from " + dbInfoTable + " where userid = ?";
		return DbManager.getInfoDb(selectString,username);
	}
}
